package com.lesso.lpq.sunflower.app.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.lesso.lpq.sunflower.domain.service.DeviceDomainService;
import com.lesso.lpq.sunflower.pojo.dto.DeviceDTO;
import com.lesso.lpq.sunflower.pojo.dto.DeviceQueryDTO;
import com.lesso.lpq.sunflower.pojo.vo.DeviceVO;
import com.lesso.lpq.sunflower.service.IDeviceService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

/**
 * DeviceServiceImpl
 *
 * @author zqz
 * @since 2025-07-02
 */
@Service
@DubboService
public class DeviceServiceImpl implements IDeviceService {
    private final DeviceDomainService deviceDomainService;

    public DeviceServiceImpl(DeviceDomainService DeviceDomainService) {
        this.deviceDomainService = DeviceDomainService;
    }

    @Override
    public Long save(DeviceDTO dto) {
        return deviceDomainService.save(dto);
    }

    @Override
    public Page<DeviceVO> page(DeviceQueryDTO dto) {
        return deviceDomainService.page(dto);
    }

    @Override
    public Page<DeviceVO> customPage(DeviceQueryDTO dto) {
        return deviceDomainService.customPage(dto);
    }

    @Override
    public void deleteById(Long id) {
        deviceDomainService.deleteById(id);
    }

    @Override
    public DeviceVO getByDeviceCode(String deviceCode) {
        return deviceDomainService.getByDeviceCode(deviceCode);
    }

}
